{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#   [Py4Hw User Guide](../UserGuide.ipynb)> 1.2 Object Oriented Approach\n",
    "###  [Next: 1.3 HWSystem](HWSystem.ipynb)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Py4hw follows an Object Oriented (OO) Approach, we extensively use Encapsulation, Inheritance and Polymorphism.\n",
    "Some [old-school] Hardware designers would not feel confortable with OO.\n",
    "My message for them would be: ***get used to it ASAP, your current HDL is either going OO or dying***.\n",
    "\n",
    "Objects can contain other objects. We use that to define the hierarchy of circuits.\n",
    "Moreover, in Python, collections of objects can be defined in several ways.\n",
    "We commonly use Python lists and directories.\n",
    "\n",
    "Modern OO languages (such as Python) let you define classes, that combine data and behaviour (functions).\n",
    "Both can be inherited from ancestor (called base) classes.\n",
    "In our case all circuits must be based on the Logic class.\n",
    "\n",
    "Below you have an example of a class, that we will use to show to dynamic manipulation features of py4hw and its OO nature."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import py4hw"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Example(py4hw.Logic):\n",
    "    \n",
    "    def __init__(self, parent, name):\n",
    "        super().__init__(parent, name)\n",
    "        \n",
    "        # Do whatever you need here\n",
    "        # for instance, now we are going to create a number of outputs\n",
    "        for i in range(10):\n",
    "            self.addOut('out{}'.format(i), None)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Contrary to many other HDL languages, in py4hw, hardware circuits do not have an explicit (static) interface. The interface is created during runtime as needed by the generator code.\n",
    "This allows to do complex things that would be impossible otherwise.\n",
    "\n",
    "The previously defined circuit only contains 10 outputs, and instantiate no logic gate.\n",
    "\n",
    "Moreover, the outputs are unconnected. Seems a crazy useless design so far."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    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kMhlOnz6Nc+fOoby8HH/5y180Po//97//LUzfvHkTERERWLx4MUaOHCk93w7gz+M1oYss2+PHj5NcLqdnz54J7fLy8ggAJSQkiMYjVtJ04MCB1LZtW0nbxY94Degiy7asrAwymQyGhobCukZGRpDL5WrZPg0xYcIEYXrZsmX48ccfoVQqAQCnTp2SFBfAT/Wi6Kqkac+ePaFQKLBs2TIUFxejqKgIS5cuRXV1tcbXgVtZWQnTHh4eGD58OE6cOAEzMzMAQFlZmaRt4+JF0FWWrY2NDQ4cOIAffvgBpqamMDc3x7Nnz+Dj44NWrVpp3V/Pnj0RExOjVRv+PF4E0mFJ0yFDhiAzMxOPHz+Gnp4eLCwsYGdnp3W2LAD88ccfCAkJ0aoNP+JFeB0lTa2trWFhYYHTp08jNzcXI0eO1CrG3NxcDBgwQMjHr5u52yhSR7dvKs0xy5aIaNeuXZSUlEQZGRm0Z88esrKyoiVLlmiMp3aypVKpJIVCIcw7ODiQra2tpO3i4jWgqyzbZcuWka2tLenr65OLiwtt2bKFqqurNcazZ8+eBr/KqVQqSk9P5yVNWyrPnz/HtGnT6pU0/eKLL9CpUyde0rSlolQqJRVQ0AQf3DEKF88oXDyjcPGMwsUzChfPKFw8o3DxjMLFMwoXzyhcPKNw8YzCxTMKF88oXDyjcPGMwsUzSovJwMnJyYFKpWrqMJocTT/IqKHZi6/5+VB1dTUePnzYxNE0H5p9smVcXBz++te/4vnz500dyhuDlGTLZi+e8+fggztG4eIZhYtnFC6eUbh4RuHiGYWLZxQunlG4eEbh4hmFi2cULp5RuHhG4eIZhYtnFC6eUbh4RuHiGYWLZxQunlG4eEbh4hmFi2cULp5RuHhG4eIZhYtnFC6eUbh4RuHiGYWLZxQunlG4eEbh4hmFi2cULp5RuHhG4eIZhYtnFC6eUbh4RuHiGYWLZxQunlG4eEb5Pw+3ydd93R4WAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 138x354 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sys = py4hw.HWSystem()\n",
    "example = Example(sys, 'example')\n",
    "#py4hw.debug.printHierarchy(example)\n",
    "sch = py4hw.Schematic(sys)\n",
    "sch.draw()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "But is is used to illustrate the power of **py4hw** to do complex behaviour like circuit modification and manipulation dynamically.\n",
    "Imagine that you now need an input to the previous circuit.\n",
    "\n",
    "We can also try to connect the outputs to some newly created wires.\n",
    "We will use a Python enumeration to traverse the output ports of the example circuit and add the missing wires accordingly."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAN8AAAEvCAYAAADFHBSBAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAks0lEQVR4nO3deVhUdfs/8PewDgw7jCAgimDIkij65JIpmhuamkua9igVGpqCmllqoplXai5hj7ZpLFqYW4GlieGaqYmSkqEGIuo3xYVFNBAQ5/794W9Ojiwzo4yfEe7Xdc3lzHDOh/sMvucM55zPjYyICIyxx85EdAGMNVYcPsYE4fAxJgiHjzFBOHyMCcLhY0wQDh9jgnD4GBOEw8eYIBw+1ijs27cPMpkMN27cEF2KhMPHmCAcPsYEaVDhS01NRdeuXeHg4ABnZ2e88MILyM3NFV1Wg0JEWLJkCVq2bAkrKysEBwdjy5YtICL06tUL/fr1g/pa/Rs3bsDLywvvvfceAODu3buIiIiAt7c3rKys4Ofnh08++URj/FdffRUvvvgiFi5cCFdXVzg4OGD+/PmoqqrCjBkz4OTkBE9PT8THx0vrnD9/HjKZDBs2bECXLl0gl8sRGBiIffv21bkthw4dQrdu3WBlZYVmzZohOjoapaWl9fuC1YUakC1bttB3331H2dnZdPz4cRo4cCA9/fTTdPfuXdGlNRizZ8+m1q1b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+++i7KyMpSWlmLGjBlQqVTIz8+vc0w7OzvpfmBgIEJDQzUCqEsPGTUOHzNahupeplQqsXnzZvz444+wsbGBvb09SkpKEBISAlNTU73H8/f3x/bt2/Vej+fzMaNFBupeBgB9+vRBbm4uCgoKYGZmBgcHB7i5uT1UF7J//vkH06ZN03s93vMxo2Wo7mX3c3FxgYODA/bs2YNr165pdKDWxa1btxAWFoYDBw4AqP5GUSedD82wRkvk0U51U6IdO3ZQVlYWhYeHk6OjIxUVFVFhYSEpFAqKjo6mnJwcSkpKInd3d40GSklJSaRQKOj48eN0/fp1Ki8vJyKi+Ph4Onz4MJ09e5a+/vprcnJyorfeektrPfc3UFIoFGRrays9dnR0JKVSqfO2cfiYVg2xe9m7775Lrq6uZG5uTq1ataLly5eTSqXSWs/u3btrPM3g6OhIGRkZer1G3L2MacXdy/519+5djBs3Dvv375ee8/HxwdKlS9G2bVt4enpy9zLGDMHU1BQJCQn1MhYfcGFMEA4fY4Jw+BgThMPHmCAcPsYE4fAxJgiHjzFBOHyMCcLhY0wQDh9jgnD4GBOEw8eYIBw+xgTh8DEmCIePMUE4fIwJwuFjTBCeyc50lp+fD09PT9FlGDVtTXfvx+FjWtna2gIAVCoVLl26JLiahoMbKDGttmzZgpiYGNy6dUt0KU8EXRsocfgYE4QPuDAmCIePMUE4fIwJwuFjTBAOH2OCcPgYE4TDx5ggHD7GBOHwMSYIh48xQTh8jAnC4WNMEA4fY4Jw+BgThMPHmCAcPsYE4fAxJgiHjzFBOHyMCcLhY0wQDh9jgnD4GBOEw8eYIBw+xgTh8DEmCIePMUE4fIwJwuFjTBAOH2OCcPgYE4TDx5ggHD7GBOHwMSYIh48xQTh8jAnC4WNMEA4fY4Jw+BgThMPHmCAcPsYE4fAxJgiHjzFBOHyMCcLhY0wQDh9jgvw/OhvX60eMESMAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 262x354 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "a = sys.wire('a', 10)\n",
    "py4hw.Constant(sys, 'a', 0xff, a)\n",
    "example.addIn('a', a)\n",
    "\n",
    "for idx, p in enumerate(example.outPorts):\n",
    "    p.wire = sys.wire('out{}'.format(idx)) \n",
    "\n",
    "sch = py4hw.Schematic(sys)\n",
    "sch.draw()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now you want to implement the circuit by instantiating some gates.\n",
    "Again, we will use Python ability to easily create lists dynamically to get all the wire objects from the output ports.\n",
    "\n",
    "By the way, in py4hw you cannot access a specific bit from wire. You always have to use a circuit to extract that bit or group of bits. You can use BitsLSBF, BitsMSBF, Bit, or Range for this."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAR4AAAI6CAYAAADxHCdrAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAABVZElEQVR4nO3deViU5f4/8PczDDDDIpuDqAikKCLu5VJYQqmIWqmYWH61BZfshGuYeVowOydDC7PScgP8WWppmqZiuJbmAhoeLTeQMgk0wQXZHJn79weH5zgywIDwMOD7dV1cwbPc85mUt888y+eWhBACREQKUtV3AUR0/2HwEJHiGDxEpDgGDxEpjsFDRIpj8BCR4hg8RKQ4Bg8RKY7BQ0SKY/CYEBQUhKlTp1a43sfHBwsXLlSsHqLGhsFTA8nJyZgwYYL8syRJ2LRpU/0VRFQHoqOj0bVr13LLi4uLERkZiaZNm8Le3h5PPfUULl68WK2xGTw1oNPpYGdnV99lENWLqVOnYuPGjVi7di3279+PmzdvYsiQISgpKTF/EFFN27dvF4GBgcLJyUm4urqKwYMHi7S0tOoOY9H69u0r/vGPf4h//OMf8vv85z//KQwGgxBCCG9vbxEbGyt/D0D+8vb2FkIIkZqaKoKCgo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DxEpDh+1CIixTF4iEhxDB4iUhyDh4gUx+AhIsUxeIhIcQweIlIcg4eIFMfgISLFMXiISHEMHiJSHIOHiBTH4CEixTF4iEhxDB4iUhyDh4gUx+AhIsUxeIhIcQweIlIcg4eIFMfgISLFMXiISHEMHiJSHIOHiBTH4CEixTF4iEhxDB4iUhyDh4gUx+AhIsUxeIhIcQweIlIcg4eIFMfgISLFMXiISHEMHiJSHIOHiBTH4CEixTF4iEhxDB4iUhyDh4gUx+AhIsUxeIhIcQweIlIcg4eIFMfgISLFMXiISHEMHiJS3P8HBR3uPpRRyKwAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 318x700 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "py4hw.BitsLSBF(example, 'bits', a, [x.wire for x in example.outPorts])\n",
    "\n",
    "sch = py4hw.Schematic(example)\n",
    "sch.draw()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's look at some of the fields of the example circuit object.\n",
    "It contains an instance of the BitsLSBF circuit, and input and output ports.\n",
    "\n",
    "You might be puzzled to see that the circuit does not have internal wires.\n",
    "Actually the wires used by the ports were created by the parent, in this case the HWSystem, which has no ports."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "For example circuit\n",
      "Child instances: {'bits': <py4hw.logic.bitwise.BitsLSBF object at 0x000002394677C5E0>}\n",
      "Internal wires: {}\n",
      "Input Ports: [<py4hw.base.InPort object at 0x0000023946EDA890>]\n",
      "Output Ports: [<py4hw.base.OutPort object at 0x000002394672BD30>, <py4hw.base.OutPort object at 0x000002394677C940>, <py4hw.base.OutPort object at 0x000002394677C8E0>, <py4hw.base.OutPort object at 0x000002394677C1F0>, <py4hw.base.OutPort object at 0x000002394677C250>, <py4hw.base.OutPort object at 0x000002394677C2B0>, <py4hw.base.OutPort object at 0x000002394677C430>, <py4hw.base.OutPort object at 0x000002394677C490>, <py4hw.base.OutPort object at 0x000002394677C4F0>, <py4hw.base.OutPort object at 0x000002394677C550>]\n",
      "\n",
      "For HWSystem circuit\n",
      "Child instances: {'example': <__main__.Example object at 0x000002394672BC40>, 'a': <py4hw.logic.bitwise.Constant object at 0x000002394677EE00>}\n",
      "Internal wires: {'clk50': <py4hw.base.Wire object at 0x000002394435B7F0>, 'a': <py4hw.base.Wire object at 0x000002394677EB90>, 'out0': <py4hw.base.Wire object at 0x0000023946EDA950>, 'out1': <py4hw.base.Wire object at 0x000002394435B730>, 'out2': <py4hw.base.Wire object at 0x000002394435AB00>, 'out3': <py4hw.base.Wire object at 0x000002394435B760>, 'out4': <py4hw.base.Wire object at 0x0000023946F58970>, 'out5': <py4hw.base.Wire object at 0x0000023946F589A0>, 'out6': <py4hw.base.Wire object at 0x0000023946F589D0>, 'out7': <py4hw.base.Wire object at 0x0000023946F59600>, 'out8': <py4hw.base.Wire object at 0x0000023946F59630>, 'out9': <py4hw.base.Wire object at 0x0000023946F59660>}\n",
      "Input Ports: []\n",
      "Output Ports: []\n"
     ]
    }
   ],
   "source": [
    "print('For example circuit')\n",
    "print('Child instances:', example.children)\n",
    "print('Internal wires:', example._wires)\n",
    "print('Input Ports:', example.inPorts)\n",
    "print('Output Ports:', example.outPorts)\n",
    "\n",
    "print()\n",
    "print('For HWSystem circuit')\n",
    "print('Child instances:', sys.children)\n",
    "print('Internal wires:', sys._wires)\n",
    "print('Input Ports:', sys.inPorts)\n",
    "print('Output Ports:', sys.outPorts)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
